import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:hovue/common/routers/pages.gr.dart';
import 'package:hovue/common/values/images.dart';
import 'package:auto_route/auto_route.dart';

@RoutePage()
class SplashPage extends StatefulWidget {
  const SplashPage({super.key});

  @override
  State<SplashPage> createState() => _SplashPageState();
}

class _SplashPageState extends State<SplashPage> {
  @override
  void initState() {
    super.initState();
    // 在启动页停留2秒后跳转到介绍页
    Future.delayed(const Duration(seconds: 2), () {
      context.router.replace(const IntroductionRoute());
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: const Color(0xFFFDF6F0), // 设置背景色为#FDF6F0
      body: Center(
        child: Image.asset(
          Images.logo2,
          width: 140.w,
          height: 140.w,
        ),
      ),
    );
  }
}
